using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Windows.Forms;
using System.Data.OleDb;

namespace ClassDB
{
    public class Log
    {
        public static LogCom.CLogFileCom[] PLogcom;

        public static void InsertLogToText(int iPlantUnitNo,string strLog, ListBox lbLog, OleDbConnection oleConn)
        {
            try
            {
                PLogcom[iPlantUnitNo].WriteString(strLog, false);
            }
            catch
            {

            }
        }

        public static void InsertLogToForm(int iPlantUnitNo,string strLog, ListBox lbLog, OleDbConnection oleConn)
        {
            try
            {
                PLogcom[iPlantUnitNo].WriteString(strLog, false);
            }
            catch
            {

            }
            strLog = System.DateTime.Now.ToString() + "   " + strLog;
            lbLog.Items.Insert(0, strLog);
            lbLog.Items.Insert(0, "");
            if (lbLog.Items.Count > 200)
                lbLog.Items.RemoveAt(lbLog.Items.Count - 1);
        }
    }
}
